<?
class App_Integral_ruleModel extends AppModel {
    protected $tableName='integral_rule';
    protected $_map=array(//字符映射
        'ruleName'=>'name',
        'category'=>'typename',
        'describe'=>'remark',
        'marks'=>'integralnum',
        'integralType'=>'integralTypeName',
    );
    //获取积分规则
    public function rule($map){
        $check=D('integral_rule')->alias('r')->join('__INTEGRAL_RULETYPE__ t on r.type_id = t.id')->where($map)->field('r.name,r.remark,integralnum,integralTypeName,t.name as typename')->select();
        $data = $check?$this->parseFieldsMap($check):'';
        return $data;
    }
}